package cn.iocoder.yudao.module.trade.dal.mysql.ordersafetycheck;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.trade.dal.dataobject.ordersafetycheck.OrderSafetyCheckDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.trade.controller.admin.ordersafetycheck.vo.*;

/**
 * 安检单 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface OrderSafetyCheckMapper extends BaseMapperX<OrderSafetyCheckDO> {

    default PageResult<OrderSafetyCheckDO> selectPage(OrderSafetyCheckPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderSafetyCheckDO>()
                .eqIfPresent(OrderSafetyCheckDO::getCrmId, reqVO.getCrmId())
                .eqIfPresent(OrderSafetyCheckDO::getCode, reqVO.getCode())
                .eqIfPresent(OrderSafetyCheckDO::getNearbyStoresId, reqVO.getNearbyStoresId())
                .likeIfPresent(OrderSafetyCheckDO::getNearbyStoresName, reqVO.getNearbyStoresName())
                .eqIfPresent(OrderSafetyCheckDO::getPitfall, reqVO.getPitfall())
                .eqIfPresent(OrderSafetyCheckDO::getIsRectify, reqVO.getIsRectify())
                .eqIfPresent(OrderSafetyCheckDO::getRepeatCheck, reqVO.getRepeatCheck())
                .eqIfPresent(OrderSafetyCheckDO::getRepeatPitfall, reqVO.getRepeatPitfall())
                .eqIfPresent(OrderSafetyCheckDO::getCheckStatus, reqVO.getCheckStatus())
                .likeIfPresent(OrderSafetyCheckDO::getCheckName, reqVO.getCheckName())
                .eqIfPresent(OrderSafetyCheckDO::getCheckId, reqVO.getCheckId())
                .eqIfPresent(OrderSafetyCheckDO::getPositionDeviation, reqVO.getPositionDeviation())
                .eqIfPresent(OrderSafetyCheckDO::getStatus, reqVO.getStatus())
                .eqIfPresent(OrderSafetyCheckDO::getOrderNo, reqVO.getOrderNo())
                .eqIfPresent(OrderSafetyCheckDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(OrderSafetyCheckDO::getRectificationId, reqVO.getRectificationId())
                .likeIfPresent(OrderSafetyCheckDO::getRectificationName, reqVO.getRectificationName())
                .likeIfPresent(OrderSafetyCheckDO::getCreateName, reqVO.getCreateName())
                .betweenIfPresent(OrderSafetyCheckDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OrderSafetyCheckDO::getId));
    }

    /**
     *  分页
     * @param pageReqVO
     * @return
     */
    List<OrderSafetyCheckRespVO> selectPageList(OrderSafetyCheckPageReqVO pageReqVO);

    /**
     *  分页查询总数
     * @param pageReqVO
     * @return
     */
    Long selectPageListByCount(OrderSafetyCheckPageReqVO pageReqVO);
}